
 
 
<!DOCTYPE html>
<html>
{include file="public/head"}
<body>

{include file="public/nav"}

{include file="community/nav"}
<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8" >
       <div class="fly-panel"> 
   <div class="fly-panel-title fly-filter"> 
       <a href="{:url('web/Message/do_delete')}"><button class="layui-btn layui-btn-danger" id="LAY_delallmsg" >清空全部消息</button></a> 
   </div> 
           <div class="nyoj-message-list">
                <ul class="mine-msg" id="message-list"> 
                </ul>
           </div>
   
            </div> 
        
          
    </div>
 {include file="public/side-bar"}
  </div>
</div>
 {include file="public/foot"}
</body>
{include file="community/js"}
<script>
 

layui.use('flow', function(){
  var flow = layui.flow;
   var $ = layui.jquery; 
  flow.load({
    elem: '#message-list' //流加载容器
    ,isAuto:false
    ,done: function(page, next){ //执行下一页的回调
      
      //模拟数据插入
        $.get("{:url('web/Message/get_more_list')}/"+page, function(res){
            next(res.html, page < res.pages);
        });
        
    }
  });
  
  
});
function mydel(id){
    layui.use('jquery',function(){
        var $=layui.jquery;
        var layer=layui.layer;
        $.ajax({
            url:'{:url("web/Message/delete_message")}/'+id
            ,success:function(res){
                if(res.code===0){
                   // layer.msg(res.msg);
                    $('#list-'+id).remove();
                }
                else
                {
                    layer.msg(res.msg);
                }
            }
        });
    });
}
function read(id){
    layui.use('jquery',function(){
        var $=layui.jquery;
        var layer=layui.layer;
        $.ajax({
            url:'/api/readmessage/'+id
            ,success:function(res){
                if(res.code===0){
                    $('#nyoj-read-'+id).remove();
                }
                else
                {
                    layer.msg(res.msg);
                }
            }
        });
    });
}
</script>
</html>